/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entity;
import java.sql.Date;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;

/**
 *
 * @author cheeseng
 */
@Entity
public class Customer extends SalesLead {

    @OneToOne(cascade = {CascadeType.PERSIST})
    private Address billingAddress;
    @OneToOne(cascade = {CascadeType.PERSIST})
    private Address shippingAddress;
    private String customerType;
    
    @OneToMany(cascade = {CascadeType.PERSIST}, mappedBy="customer")
    private List<PurchaseOrder> purchaseOrders = new ArrayList();
    @ManyToOne
    private SystemUser systemUser;

    //private sale history
    public void create(String customerType) {
        this.customerType = customerType;

    }

    public List<PurchaseOrder> getPurchaseOrders() {
        return purchaseOrders;
    }

    public void setPurchaseOrders(List<PurchaseOrder> purchaseOrder) {
        this.purchaseOrders = purchaseOrder;
    }

    public String getCustomerType() {
        return customerType;
    }

    public void setCustomerType(String customerType) {
        this.customerType = customerType;
    }

    public SystemUser getSystemUser() {
        return systemUser;
    }

    public void setSystemUser(SystemUser systemUser) {
        this.systemUser = systemUser;
    }

    public Address getBillingAddress() {
        return billingAddress;
    }

    public void setBillingAddress(Address billingAddress) {
        this.billingAddress = billingAddress;
    }

    

    public Address getShippingAddress() {
        return shippingAddress;
    }

    public void setShippingAddress(Address shippingAddress) {
        this.shippingAddress = shippingAddress;
    }
}
